package com.wordsay.entity;

import java.util.LinkedList;
import java.util.List;

import com.wordsay.util.DateTimeUtil;

public class OverallAnalystResult extends AnalystResult {

	private List<String> dialogPersons;
	private List<String> dialogGroups;
	private List<String> dialogDicussions;
	
	private List<HotItem> topHotWords;
	private String topHotPersons;
	private String topHotGroups;
	private String topHotDicussions;
	
	private long totalWordsCount;
	private long totalTalkCount;
	private Talk firstTalk;
	private Talk lastTalk;
	private Talk mostWordsTalk;
	private List<HotItem> hotChatPeriod;
	private  List<HotItem> hotChatWeekDay;
	private  List<HotItem> hotDay;
	
	public void printResult() throws Exception{
		
		System.out.println("-------------------------------------------------------");
		System.out.println("dialog person count:"+dialogPersons.size()+"个人");
		System.out.println(" ------they are:");
		for(String name: dialogPersons){System.out.print(name+",");}
		System.out.println("\n");
		System.out.println("dialog groups count:"+dialogGroups.size()+"个群");
		System.out.println(" ------they are:");
		for(String name: dialogGroups){System.out.print(name+",");}
		System.out.println("\n");
		System.out.println("dialog discussion count:"+dialogDicussions.size()+"个讨论组");
		System.out.println(" ------they are:");
		for(String name: dialogDicussions){System.out.print(name+",");}
		
		System.out.println("---------------------------------------------------------");
        System.out.println("最火的词是：");
		for(int i = 0; i < topHotWords.size(); i++){HotItem item = topHotWords.get(i);System.out.println("第"+(i+1)+". ->"+item.getName()+"("+item.getFrequency()+"次出现)");}
        
        String[] hotGroup = topHotGroups.split("_");
		System.out.println("最热闹的群是："+hotGroup[0]+" 总共有："+hotGroup[1]+"个成员，总共说了:"+hotGroup[2]+"句话");
		String[] hotDiscussion = topHotDicussions.split("_");
		System.out.println("最热闹的讨论组是："+hotDiscussion[0]+" 总共有："+hotDiscussion[1]+"个成员，总共说了:"+hotDiscussion[2]+"句话");
		String[] hotPerson = topHotPersons.split("_");
		System.out.println("和我聊天最多的人是："+hotPerson[0]+" 我们一共说了："+hotPerson[1]+"句话");

		System.out.println("---------------------------------------------------------");
        System.out.println("总共说了："+totalTalkCount+"句话");
        System.out.println("总共说了"+totalWordsCount+"个词组");
        System.out.println("第一句话是和："+firstTalk.getSpeaker().getName()+" at:"+DateTimeUtil.converToString(firstTalk.getTime())+" said:"+firstTalk.getMessage());
        System.out.println("最后一句话是和"+lastTalk.getSpeaker().getName()+" at:"+DateTimeUtil.converToString(lastTalk.getTime())+" said:"+lastTalk.getMessage());
        System.out.println("说了最多的一句话是："+mostWordsTalk.getSpeaker().getName()+" at:"+DateTimeUtil.converToString(mostWordsTalk.getTime())+" 对话中使用了："+mostWordsTalk.getIwords().size()+"个词组");

		
		System.out.println("-------------------------------------------------------");
        System.out.println("最常聊天的时间段是："+hotChatPeriod.get(0).getName()+"点 ("+hotChatPeriod.get(0).getFrequency()+"句话)  ,"+hotChatPeriod.get(1).getName()+" 点("+hotChatPeriod.get(1).getFrequency()+"句话),"+hotChatPeriod.get(2).getName()+" 点("+hotChatPeriod.get(2).getFrequency()+"句话)");
        System.out.println("最常聊天的星期是："+hotChatWeekDay.get(0).getName()+"("+hotChatWeekDay.get(0).getFrequency()+"句话)  ,"+hotChatWeekDay.get(1).getName()+"("+hotChatWeekDay.get(1).getFrequency()+"句话),"+hotChatWeekDay.get(2).getName()+"("+hotChatWeekDay.get(2).getFrequency()+"句话)");
        System.out.println("聊天最多的日期是："+hotDay.get(0).getName()+"("+hotDay.get(0).getFrequency()+"句话)  ,"+hotDay.get(1).getName()+"("+hotDay.get(1).getFrequency()+"句话),"+hotDay.get(2).getName()+"("+hotDay.get(2).getFrequency()+"句话)");

	}
	
	public List<String> getDialogPersons() {
		return dialogPersons;
	}
	public void setDialogPersons(List<String> dialogPersons) {
		this.dialogPersons = dialogPersons;
	}
	public List<String> getDialogGroups() {
		return dialogGroups;
	}
	public void setDialogGroups(List<String> dialogGroups) {
		this.dialogGroups = dialogGroups;
	}
	public List<String> getDialogDicussions() {
		return dialogDicussions;
	}
	public void setDialogDicussions(List<String> dialogDicussions) {
		this.dialogDicussions = dialogDicussions;
	}
	
	public long getTotalWordsCount() {
		return totalWordsCount;
	}
	public void setTotalWordsCount(long totalWordsCount) {
		this.totalWordsCount = totalWordsCount;
	}
	public Talk getFirstTalk() {
		return firstTalk;
	}
	public void setFirstTalk(Talk firstTalk) {
		this.firstTalk = firstTalk;
	}
	public Talk getLastTalk() {
		return lastTalk;
	}
	public void setLastTalk(Talk lastTalk) {
		this.lastTalk = lastTalk;
	}
	
	
	public List<HotItem> getTopHotWords() {
		return topHotWords;
	}

	public void setTopHotWords(List<HotItem> topHotWords) {
		this.topHotWords = topHotWords;
	}

	public String getTopHotPersons() {
		return topHotPersons;
	}
	public void setTopHotPersons(String topHotPersons) {
		this.topHotPersons = topHotPersons;
	}
	public String getTopHotGroups() {
		return topHotGroups;
	}
	public void setTopHotGroups(String topHotGroups) {
		this.topHotGroups = topHotGroups;
	}
	public String getTopHotDicussions() {
		return topHotDicussions;
	}
	public void setTopHotDicussions(String topHotDicussions) {
		this.topHotDicussions = topHotDicussions;
	}

	public long getTotalTalkCount() {
		return totalTalkCount;
	}
	public void setTotalTalkCount(long totalTalkCount) {
		this.totalTalkCount = totalTalkCount;
	}
	public List<HotItem> getHotChatWeekDay() {
		return hotChatWeekDay;
	}
	public void setHotChatWeekDay(List<HotItem> hotChatWeekDay) {
		this.hotChatWeekDay = hotChatWeekDay;
	}
	public void setHotChatPeriod(List<HotItem> hotChatPeriod) {
		this.hotChatPeriod = hotChatPeriod;
	}
	public List<HotItem> getHotDay() {
		return hotDay;
	}
	public void setHotDay(List<HotItem> hotDay) {
		this.hotDay = hotDay;
	}
	public List<HotItem> getHotChatPeriod() {
		return hotChatPeriod;
	}
	public Talk getMostWordsTalk() {
		return mostWordsTalk;
	}
	public void setMostWordsTalk(Talk mostWordsTalk) {
		this.mostWordsTalk = mostWordsTalk;
	}
	
}
